CFLAGS = `pkg-config --libs --cflags glib-2.0 gio-2.0`

CLIENT_DEMO_SRC = ipc_client_demo.c 
SERVER_DEMO_SRC = ipc_server_demo.c mcu_controller.c radio_controller.c

TARGET = libipc.so ipc_client ipc_server

all: $(TARGET)

libipc.so: ipc_client.c ipc_server.c ipc_util.c ipc_data.c 
	gcc -g -Wall -fPIC --shared $^ -o $@ $(CFLAGS)

ipc_client: $(CLIENT_DEMO_SRC) libipc.so
	gcc -g -Wall $(CLIENT_DEMO_SRC) -o $@ $(CFLAGS) -L. -lipc 

ipc_server: $(SERVER_DEMO_SRC) libipc.so
	gcc -g -Wall $(SERVER_DEMO_SRC) -o $@ $(CFLAGS) -L. -lipc 
	
clean:
	rm $(TARGET)